using System;
using System.Globalization;
using System.Windows.Data;

namespace Haidou.Wpf.Util.Converters;

public class IntToString : IValueConverter
{
	public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
	{
		return value is not int number || number == 0 ? "" : (object)number.ToString();
	}

	public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
	{
		return value;
	}
}